var CryptoJS = require('crypto-js');

function AESencrypt(e) {
    "use strict";
    var n = "BBSWA166442B66F0",
        i = "b8a4c89cdc776729";
    return CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(e), CryptoJS.enc.Utf8.parse(n), {
        iv: CryptoJS.enc.Utf8.parse(i),
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7
    }).toString();
}

function AESdecrypt(e) {
    "use strict";
    var n = "BBSWA166442B66F0",
        i = "b8a4c89cdc776729",
        r = CryptoJS.AES.decrypt(e, CryptoJS.enc.Utf8.parse(n), {
            iv: CryptoJS.enc.Utf8.parse(i),
            mode: CryptoJS.mode.CBC,
            padding: CryptoJS.pad.Pkcs7
        }),
        s = r.toString(CryptoJS.enc.Utf8);
}
function json2str() {
    "use strict";
    var e = {
        "title": "",
        "page": 1,
        "limit": 10,
        "field": "upo.created_at",
        "sort": "desc",
        "type": -1,
        "lable": -1,
        "sign_time": parseInt(Date.now() / 1000)
    };
    return JSON.stringify(e);
}
